/*
  LinkSpriteCam.h - Library for flashing Morse code.
  Created by Mike Henrey, June 15 2013.	
  Copyright 2013 Mike Henrey 

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along 
with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/* For use with Arduino 1.05 */


#ifndef LinkSpriteCam_h
#define LinkSpriteCam_h

#include "Arduino.h"

class LinkSpriteCam
{
  public:
  LinkSpriteCam();
  boolean Begin(int baudRate, int _readBuffSize, int _spacingInterval);
  boolean SendResetCmd();
  boolean ReadInitSequence();
  word GetFileSize();
	void SendTakePhotoCmd();
	boolean SetLargeSizeCmd();
	void CheckPhotoCaptured();
	void SendReadDataCmd();
	void StopTakePhotoCmd();
	void StopPowerSavingsCmd();
	void StartPowerSavingsCmd();
	int FillReadBuffer(byte *serData);
	
	// getters and setters
	void Seta(int _a);
	int Geta();
	void Decreasea(int decreaseAmount);

  private:
    static const int TIMEOUT_MAX = 1000;
    uint8_t MH;
    uint8_t ML;
    long a;                    //Read Starting address
    int readBuffSize;
    int spacingInterval;
};

#endif